depth first search in data structure